From: Florian Müllner Date: Sat, 7 Mar 2020 18:28:48 +0000 (+0100) Subject: fileUtils: Remove some compatibility code X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~151 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a5a6c699c35e33fe841742952202fde33d942a07;p=gnome-shell.git fileUtils: Remove some compatibility code The condition was added to keep working with the then-stable version of gjs. We already require a more recent version now, so the compat code is effectively dead. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1077 --- diff --git a/js/misc/fileUtils.js b/js/misc/fileUtils.js index 1abe64c2e..e672f68bd 100644 --- a/js/misc/fileUtils.js +++ b/js/misc/fileUtils.js @@ -76,19 +76,15 @@ function loadInterfaceXML(iface) { _ifaceResource._register(); } - let xml = null; let uri = `resource:///org/gnome/shell/dbus-interfaces/${iface}.xml`; let f = Gio.File.new_for_uri(uri); try { let [ok_, bytes] = f.load_contents(null); - if (bytes instanceof Uint8Array) - xml = imports.byteArray.toString(bytes); - else - xml = bytes.toString(); + return imports.byteArray.toString(bytes); } catch (e) { log(`Failed to load D-Bus interface ${iface}`); } - return xml; + return null; }